package com.tongyi.shop.service.user.controller;

import com.tongyi.shop.common.pojo.vo.BaseResponse;
import com.tongyi.shop.service.user.feign.OrderServiceFeign;
import com.tongyi.shop.service.user.pojo.dto.ErpOrderStatusLogDto;
import com.tongyi.shop.service.user.pojo.mapstruct.OrderStatusMapStruct;
import com.tongyi.shop.service.user.pojo.vo.ErpOrderStatusLogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class TestController {

    @Autowired
    private OrderServiceFeign orderServiceFeign;
    @Autowired
    private OrderStatusMapStruct orderStatusMapStruct;

    @GetMapping("/getTestData")
    public BaseResponse<ErpOrderStatusLogDto> echo(String id) {
        BaseResponse<ErpOrderStatusLogDto> dataInfo = orderServiceFeign.getDataInfo(id);
        ErpOrderStatusLogVo convert = orderStatusMapStruct.convert(dataInfo.getData());
        System.out.println(convert);
        return dataInfo;
    }
}
